﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace PM.Entity
{
    public class Dividend
    {
        #region property
        public string CompanyId { get; set; }
        public string Name { get; set; }
        public DateTime AnnouncedDate { get; set; }
        public Decimal RateOfDividend { get; set; }
        public string DividendType { get; set; }
        public string FinancialYear { get; set; }
        public DateTime XD { get; set; }
        public DateTime Payment { get; set; }
        public string Remarks { get; set; }
        public decimal TaxRate { get; set; }

        #region ScripDividend
        public decimal Propotion { get; set; }
        public Int64 NoOfNewSharesListed { get; set; }
        #endregion

        #region BonusIssue
        public decimal ValuePerShare { get; set; }
        #endregion

        #region RightsIssue
        public DateTime RenunciationDate { get; set; }
        public DateTime TradeCommencementDate { get; set; }
        public bool IsRightsIssue { get; set; }
        #endregion
        
        #endregion

        public Dividend()
        {
            /* Saves the Id with N or X to indicate whether it is voting or non-voting*/
            this.CompanyId = string.Empty;
            this.Name = string.Empty;            
            this.AnnouncedDate = DateTime.MinValue;
            /* Date of Commencement of trading (Share split)*/
            this.XD = DateTime.MinValue;
            /*Payment date, Scrip dividend date, Last date of Acceptance & payment date(Right Issue) */
            this.Payment = DateTime.MinValue;
            this.Remarks = string.Empty;
            this.TaxRate = 0;

            #region Dividend
            this.RateOfDividend = decimal.MinusOne;
            this.DividendType = string.Empty;
            this.FinancialYear = string.Empty;
            #endregion

            #region ScripDividend
            this.Propotion = decimal.MinusOne;
            this.NoOfNewSharesListed = 0;            
            #endregion

            #region BonusIssue
            this.ValuePerShare = decimal.MinusOne;            
            #endregion

            #region RightsIssue
            this.RenunciationDate = DateTime.MinValue;
            this.TradeCommencementDate = DateTime.MinValue;
            this.IsRightsIssue = false;
            #endregion


        }
    }

    public class DividendCollection : Collection<Dividend>
    {
        public DividendCollection()
        {
        }
    }
}
